//
//  LocalAuthenticationManager.h
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/7.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import <Foundation/Foundation.h>
//框架
#import <LocalAuthentication/LocalAuthentication.h>

///supports waht
typedef NS_ENUM(NSInteger,DDLABiometryType) {
    DDLABiometryTypeNone,
    /// The device supports Touch ID.
    DDLABiometryTypeTouchID,
    /// The device supports Face ID.
    DDLABiometryTypeFaceID,
};

typedef void(^LocalAuthenticationCompleteBlcok)(BOOL success,NSError *error);

NS_ASSUME_NONNULL_BEGIN
/**
 指纹登录或者面容登录的管理器
 */
@interface LocalAuthenticationManager : NSObject

+ (instancetype)sharedLocalAuth;
/**
 *是否支持指纹或者面容
 */
@property (nonatomic, assign, readonly) BOOL isSupportLocalAuth;
/**
 *biometryType
 */
@property (nonatomic, assign, readonly) DDLABiometryType biometryType;

/**
 * !@brief 开启一次验证
 * @param fromController 提供给alertController弹出错误信息
 */
- (void)startLocalAuthenticationFromController:(UIViewController *)fromController complete:(LocalAuthenticationCompleteBlcok)complete;

@end

NS_ASSUME_NONNULL_END
